package com.jh.pattern.singleton.lazy;

/**
 * @author JH_Wong
 * @projectName newforward
 * @title ExectorThread.java
 * @package com.jh.pattern.singleton.lazy
 * @description 线程获取懒汉实例
 * @date 2019-05-10 17:31
 */
public class ExectorThread extends Thread{
    @Override
    public void run() {

        // 静态内部类懒汉单例
        LazyInnerClassSingleton singleton = LazyInnerClassSingleton.getInstance();

        // 二次检查懒汉单例
        //LazyDoubleCheckSingleton singleton = LazyDoubleCheckSingleton.getInstance();

        // 普通懒汉单例
        //LazySingleton singleton = LazySingleton.getInstance();

        System.out.println("instance：" + singleton);
    }
}
